#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int T, i;
int arr[100003];
int main()
{
	cin >> T;
	int n;
	for (i = 0; i < T; i++) {
		scanf("%d", &n);
		if ((n - 1) % 3 == 0) {
			arr[i] = 1;
		}
		else if (n % 2 == 0 && n >= 6) {
			arr[i] = 1;
		}
		else if (n > 8 && (n - 9) % 2 == 0) {
			arr[i] = 1;
		}
	}
	for (i = 0; i < T; i++) {
		if (arr[i]) 
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}